package com.hy.demo.learn.java基础类库.CharSeQuence接口;

/**
 * <p>
 * charSequence
 * </p>
 *
 * @author cjl
 * @version 1.0
 * @since 2020-08-27 14:06
 */
public class JavaDemo {
    public static void main(String[] args) {
        CharSequence str="www.baidu.com"; // 子类实例向父接口转型


        // CharSequence 描述的就是一个字符串
        CharSequence sub= str.subSequence(4,9);
        System.out.println(sub);
    }
}
